﻿using System.Drawing;

namespace HAOest.Forms.Mouse
{
    /// <summary>
    /// 鼠标调整右边大小类
    /// </summary>
    public class MouseSizeRight : MouseAction
    {
        private int startMousePositionX;
        /// <summary>
        /// 鼠标调整右边大小
        /// </summary>
        public MouseSizeRight()
        {
            this.startMousePositionX = Functions.GetMousePosition().X;
        }

        /// <summary>
        /// 执行方法
        /// </summary>
        /// <param name="form">传入的窗口</param>
        public override void Action(System.Windows.Forms.Form form)
        {
            Point point = Functions.GetMousePosition();
            form.Width = point.X - form.Left + 2;
            form.Update();
        }
    }
}
